/**
 * 1+1+1+1....1   求100个1相加的和
 *   累加求和
 *      _  +  _ + _ + .... + _   = ?
 *
 *     var s = 0  //累加和
 *     for(var i = 1;  i<= 100;  i++){
 *          s = s + 累加项
 *     }
 *
 */
function getTotal() {
	var s = 0
	for (var i = 1; i <= 100; i++) {
		s = s + 1
	}
	console.log('100个1的和是 ', s)
}

function getSum() {
	var s = 0
	for (var i = 1; i <= 100; i++) {
		s = s + i
	}
    return s
}

var sum = getSum()
console.log('1+2+..+100的和是 ', sum)